//
//  ZVideoCollectionViewCell.m
//  DoctorFAQs
//
//  Created by zjq on 17/2/21.
//  Copyright © 2017年 zjq. All rights reserved.
//

#import "ZVideoCollectionViewCell.h"

@implementation ZVideoCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self initlizeInterface];
    }
    return self;
}
- (void)setDModel:(ZDVideoModel *)dModel {
    _dModel = dModel;
    [_substanceView  sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",IconURL,_dModel.cover]]];
    _nameLabel.text = _dModel.title;
}
- (void)initlizeInterface {
    _substanceView = [[UIImageView alloc]init];
    _substanceView.backgroundColor = [UIColor whiteColor];
    _nameLabel = [[UILabel alloc] init];
    _nameLabel.text = @"";
    _nameLabel.textAlignment = NSTextAlignmentCenter;
    _nameLabel.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:_substanceView];
    [self.contentView addSubview:_nameLabel];
    [_substanceView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.width.equalTo(self.contentView);
        make.height.offset(90*ysIZE);
    }];
    [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(_substanceView);
        make.width.equalTo(_substanceView).multipliedBy(0.7);
        make.height.offset(16*ysIZE);
        make.bottom.equalTo(self.contentView).offset(-10*ysIZE);
    }];
}
@end
